import React from 'react';
import { render} from 'react-dom';
import { HashRouter, Switch, Route} from 'react-router-dom'
import { Provider} from 'react-redux'
import store from './redux/store'

import Register from './containers/register/register'
import Login from './containers/login/login'
import Main from './containers/main/main'


import './assets/common.css'

//引入 socketio文件
// import './socketio/socket'

/*
    处理重定向  子组件之间的条状  最好不要在父组件跳转
    但是可以处理 子组件 跳转到其他非子组件
 */

render(
    <Provider store={ store}>
    <HashRouter>
        <Switch>
            <Route path='/register' component={ Register} />
            <Route path='/login' component={ Login} />
            <Route component={ Main} />
        </Switch>
    </HashRouter>
</Provider>,
document.getElementById('root')
)